home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Presentations / Presentations ’96 / Sessions ’96 / ODF- Easy OpenDoc / MacHack(2) / Sources / Part.cpp < prev    next >
Encoding:
Text File  |  1996-06-18  |  3.3 KB  |  128 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.cpp
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PART_H
  11. #include "Part.h"
  12. #endif
  13.  
  14. #ifndef DEFINES_K
  15. #include "Defines.k"
  16. #endif
  17.  
  18. #ifndef BINDING_K
  19. #include "Binding.k"
  20. #endif
  21.  
  22. #ifndef FWABOUT_H
  23. #include "FWAbout.h"
  24. #endif
  25.  
  26. // ----- Framework Includes -----
  27.  
  28. #ifndef FWUTIL_H
  29. #include "FWUtil.h"
  30. #endif
  31.  
  32. #ifndef FWCFMRES_H
  33. #include "FWCFMRes.h"
  34. #endif
  35.  
  36. #ifndef FWSHAPE_H
  37. #include "FWShape.h"
  38. #endif
  39.  
  40. //========================================================================================
  41. //    Runtime informations
  42. //========================================================================================
  43.  
  44. #ifdef FW_BUILD_MAC
  45. #pragma segment machack
  46. #endif
  47.  
  48. //========================================================================================
  49. //    CLASS CMacHackPart
  50. //========================================================================================
  51.  
  52.  
  53. FW_DEFINE_AUTO(CMacHackPart)
  54.     
  55. //----------------------------------------------------------------------------------------
  56. //     CMacHackPart::CMacHackPart
  57. //----------------------------------------------------------------------------------------
  58.  
  59. CMacHackPart::CMacHackPart(ODPart* odPart):
  60.     FW_CPart(odPart, FW_gInstance, kPartInfoID)
  61. {
  62. }
  63.  
  64. //----------------------------------------------------------------------------------------
  65. //     CMacHackPart::~CMacHackPart
  66. //----------------------------------------------------------------------------------------
  67.  
  68. CMacHackPart::~CMacHackPart()
  69. {
  70. }
  71.  
  72. //----------------------------------------------------------------------------------------
  73. //     CMacHackPart::Initialize
  74. //----------------------------------------------------------------------------------------
  75.  
  76. void CMacHackPart::Initialize(Environment* ev)
  77. {
  78.     FW_CPart::Initialize(ev);
  79.     
  80.     fPresentation = RegisterPresentation(ev, "Apple:Presentation:MacHack", TRUE);
  81. }
  82.  
  83. //----------------------------------------------------------------------------------------
  84. //     CMacHackPart::NewFrame
  85. //----------------------------------------------------------------------------------------
  86.  
  87. FW_CFrame* CMacHackPart::NewFrame(Environment* ev, 
  88.                                   ODFrame* odFrame, 
  89.                                   FW_CPresentation* presentation, 
  90.                                   FW_Boolean fromStorage)
  91. {
  92. FW_UNUSED(presentation);
  93. FW_UNUSED(fromStorage);
  94.     
  95.     return FW_NEW(FW_CFrame, (ev, odFrame, presentation, this, kMacHackView));
  96. }
  97.  
  98. //----------------------------------------------------------------------------------------
  99. //     CMacHackPart::NewPartContent
  100. //----------------------------------------------------------------------------------------
  101.  
  102. FW_CContent* CMacHackPart::NewPartContent(Environment* ev)
  103. {
  104.     return NULL;
  105. }
  106.  
  107. //----------------------------------------------------------------------------------------
  108. //    CMacHackPart::DoMenu
  109. //----------------------------------------------------------------------------------------
  110.  
  111. FW_Boolean CMacHackPart::DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent)
  112. {
  113.     FW_Boolean result = TRUE;
  114.     ODCommandID commandID = theMenuEvent.GetCommandID(ev);
  115.  
  116.     switch (commandID)
  117.     {
  118.         case kODCommandAbout:
  119.             ::FW_About(ev, this, kAbout);
  120.             break;
  121.                         
  122.         default:
  123.             result = false;        
  124.     }
  125.     
  126.     return result;
  127. }
  128.